import { Input, Radio, Space } from 'antd';
import CommonModal from '@/components/CommonModal';
import React, { useState } from 'react';
const CommonBatchCopy = ({visible, title, copyType, max, handleOk, handleCancel}) => {
    
    const selectData = {
        '1': [
            {
                value: '1',
                label: '商品编码'
            },
            {
                value: '2',
                label: '款式编码'
            }
        ],
        '2': [
            {
                value: '1',
                label: '商品编码'
            },
            {
                value: '2',
                label: '款式编码'
            },
            {
                value: '3',
                label: '商品唯一码'
            }
        ],
        '3': [
            {
                value: '4',
                label: '店铺订单号'
            },
            {
                value: '5',
                label: '外部erp单号'
            },
            {
                value: '6',
                label: '外部平台源单号'
            }
        ]
    }
    const [value, setValue] = useState(selectData[copyType][0].value);

    const onChange = (e) => {
        setValue(e.target.value);
    };

    return (
       <CommonModal
        title={title}
        visible={visible}
        onOk={() => handleOk(value)}
        onCancel={handleCancel}
       >
        <div>复制<span style={{color: 'red'}}>勾选订单</span>的对应订单号，最多复制{max}个</div>
        <Radio.Group onChange={onChange} value={value} style={{margin: '20px'}}>
            <Space direction="vertical">
                {
                    selectData[copyType] && selectData[copyType].map(item => {
                        return <Radio value={item.value} key={item.value}>{item.label}</Radio>
                    })
                }
            </Space>
            </Radio.Group>
       </CommonModal>
    )
}

export default CommonBatchCopy;